package com.vma.shoeSystem.controller;

import com.jfinal.core.Controller;
import com.vma.shoeSystem.util.ReturnsUtil;
import com.vma.shoes.bizModel.model.AboutUs;

import java.util.Date;

/**
 * Created by chenzui on 2017/5/23.
 */
public class AboutUsController extends Controller {

    public void init(){
        AboutUs aboutUs = AboutUs.dao.findFirst("SELECT * FROM about_us ORDER BY create_time DESC ");
        setAttr("aboutUs",aboutUs);
        renderVelocity("/shop/aboutUs/aboutUs.html");
    }

    public void add(){
        new AboutUs().setCreateTime(new Date()).setStatus("1").setConent(getPara("content")).save();
        renderJson(ReturnsUtil.returnSuccess("success"));
    }
}
